<?php
/*
 * Created on 2010-7-6
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 class Message extends Base{
 	protected $_name='my_guestbook';
 	protected $_pramary='id';
	/*
	 * 添加留言
	 */
	function addMessage($data){
		return $this->insert($data);

	}
	/*
	 * 获取留言
	 */
	 function getMessage(){
		$data=$this->fetchAll()->toArray();
		return $data;
	 }
	 /*
	  *删除留言
	  */
	  function delMessage($id){
		$db=$this->getAdapter();
		$where=$db->quoteInto('id = ?',$id);
		return $this->delete($where);
	  }
	  /*
	   *获取留言数
	   */
	   function messageNums(){
		$num=$this->fetchAll()->count();
		return $num;
	   }
 }
?>
